<template>
  <view class="index">
    <view class="jtop">
      <view class="status_bar"><!-- 这里是状态栏 --></view>
      <view class="jtop_l" @tap="navigateBack"
        ><image src="../../static/img/ic_back.png"></image
      ></view>
      <view class="jtop_c">无锡天府广场项目</view>
      <view class="jtop_r" @tap="togis()"
        ><image src="../../static/img/doc/ic_ellipsis.png"></image
      ></view>
      <view class="jtop_r jtop_rl" @tap="jshow_pop('jtop_rl')"
        ><image src="../../static/img/doc/ic_add.png"></image
      ></view>
    </view>
    <view class="tophr"></view>
    <uni-search-bar
      placeholder="搜索"
      @confirm="search"
      class="ss"
    ></uni-search-bar>
    <view class="nav">
      <text>共享</text><image src="../../static/img/mbx.png" mode=""></image
      ><text>项目盘</text><image src="../../static/img/mbx.png" mode=""></image
      ><text class="active">天府广场项目</text>
    </view>

    <view class="doc_t">文件夹</view>

    <view class="doc_bs">
      <view class="doc_b ">
        <image src="../../static/img/doc/ic_folder.png" class="doc_bl"></image>
        <text class="doc_bt">天府广场项目</text>
        <image
          src="../../static/img/doc/ic_ellipsis 3.png"
          class="doc_br"
          @click="jshow_pop"
        ></image>
      </view>
      <view class="doc_b ">
        <image src="../../static/img/doc/ic_folder.png" class="doc_bl"></image>
        <text class="doc_bt">上海万达广场项目</text>
        <image
          src="../../static/img/doc/ic_ellipsis 3.png"
          class="doc_br"
          @click="jshow_pop"
        ></image>
      </view>
      <view class="doc_b noborder">
        <image src="../../static/img/doc/ic_folder.png" class="doc_bl"></image>
        <text class="doc_bt">徐州碧桂园项目</text>
        <image
          src="../../static/img/doc/ic_ellipsis 3.png"
          class="doc_br"
          @click="jshow_pop"
        ></image>
      </view>
    </view>
    <view class="doc_t">文件</view>
    <view class="doc_bs">
      <view class="doc_b">
        <image src="../../static/img/doc/ic_word.png" class="doc_bl"></image>
        <view class="doc_b2">
          <text class="doc_b2t">墨斗项目需求.doc</text>
          <text class="doc_b2f">10K · 宋旋 · 05/10</text>
        </view>
        <image
          src="../../static/img/doc/ic_ellipsis 3.png"
          class="doc_br"
          @click="jshow_pop"
        ></image>
      </view>
      <view class="doc_b">
        <image src="../../static/img/doc/ic_excel.png" class="doc_bl"></image>
        <view class="doc_b2">
          <text class="doc_b2t">信息收集表.xls</text>
          <text class="doc_b2f">20K · 宋旋 · 06/02</text>
        </view>
        <image
          src="../../static/img/doc/ic_ellipsis 3.png"
          class="doc_br"
          @click="jshow_pop"
        ></image>
      </view>
      <view class="doc_b">
        <image src="../../static/img/doc/ic_pdf.png" class="doc_bl"></image>
        <view class="doc_b2">
          <text class="doc_b2t">安全技术交底多组示例.pdfc</text>
          <text class="doc_b2f">97.4M · 宋旋 · 2019/12/02</text>
        </view>
        <image
          src="../../static/img/doc/ic_ellipsis 3.png"
          class="doc_br"
          @click="jshow_pop"
        ></image>
      </view>
      <view class="doc_b noborder">
        <image
          src="../../static/img/doc/ic_file_unknowl.png"
          class="doc_bl"
        ></image>
        <view class="doc_b2">
          <text class="doc_b2t">安全技术交底多组示例</text>
          <text class="doc_b2f">97.4M · 宋旋 · 2019/12/02</text>
        </view>
        <image
          src="../../static/img/doc/ic_ellipsis 3.png"
          class="doc_br"
          @click="jshow_pop"
        ></image>
      </view>
    </view>

    <!-- 弹出层 -->
    <view :class="[ashowpop ? 'tc' : 'tc hide']">
      <view class="jtop_bj" @click="jshow_pop"></view>

      <view :class="[ashowpop_jtop_rl ? 'tc_fbox' : 'tc_fbox hide']">
        <view class="tc_fboxs">
          <view class="tc_fbox_ic" @tap="changeAvatar()">
            <image src="../../static/img/doc/ic_pic.png"></image>
            <text>上传照片</text>
          </view>

          <view class="tc_fbox_ic">
            <l-file ref="lFile" @up-success="onSuccess"></l-file>

            <view @tap="onUpload">
              <image src="../../static/img/doc/ic_file.png"></image>
              <text>上传文件</text>
            </view>
          </view>
          <view class="tc_fbox_ic" @click="jshow_pop('jrename')">
            <image src="../../static/img/doc/ic_folde2r.png"></image>
            <text>新建文件夹</text>
          </view>
        </view>
        <view class="tc_fbox_bt" @click="jshow_pop">
          取消
        </view>
      </view>

      <!-- 分享 -->
      <view :class="[ashowpopT ? 'tc_fbox' : 'tc_fbox hide']">
        <view class="tc_tt">
          墨斗文档
        </view>
        <view class="ddf" @tap="to_sh">
          <image src="../../static/img/doc/ic_transpond_1.png"></image>
          <text>转发</text>
        </view>
        <view class="ddf">
          <image src="../../static/img/doc/ic_wechat.png"></image>
          <text>分享到微信</text>
        </view>
        <view class="ddf" @click="open(0)">
          <image src="../../static/img/doc/ic_other.png"></image>
          <text>用其他应用打开</text>
        </view>
        <view class="clear"> </view>
        <view class="ddf" @tap="jshow_pop('jrename2')">
          <image src="../../static/img/doc/ic_rename.png"></image>
          <text>重命名</text>
        </view>
        <view class="ddf" @tap="jshow_pop('jdel')">
          <image src="../../static/img/doc/ic_delet_1.png"></image>
          <text>删除</text>
        </view>
        <view class="ddf" @tap="bt_yd">
          <image src="../../static/img/doc/ic_move_1.png"></image>
          <text>移动</text>
        </view>
        <view class="ddf">
          <image src="../../static/img/doc/ic_selected.png"></image>
          <text>选中</text>
        </view>
        <view class="tc_fbox_bt" @tap="jshow_pop">
          取消
        </view>
      </view>

      <!-- 重命名 -->
      <view :class="[ashowpop_jrename ? 'tc_box' : 'tc_box hide']">
        <view class="tc_boxt">
          新建文件夹
        </view>
        <view class="tc_boxtc">
          请输入文件夹名称
        </view>
        <view class="tc_boxi">
          <input
            type="text"
            placeholder="请输入文件夹名称"
            :value="jname"
            @input="onKeyInput_c"
          />
          <image
            src="../../static/img/ic_login_delete.png"
            class="tc_boxi_jdel"
            v-if="jname"
          ></image>
        </view>
        <view class="tc_f">
          <view class="tc_fl" @tap="jshow_pop">取消</view>
          <view
            class="tc_fr"
            :style="{ opacity: jname ? '1' : '.6' }"
            @tap="jsave"
            >确定</view
          >
        </view>
      </view>

      <!-- 重命名 -->
      <view :class="[ashowpop_jrename2 ? 'tc_box' : 'tc_box hide']">
        <view class="tc_boxt">
          重命名
        </view>
        <view class="tc_boxtc">
          请输入文件夹名称
        </view>
        <view class="tc_boxi">
          <input
            type="text"
            placeholder="请输入文件夹名称"
            :value="jname"
            @input="onKeyInput_c"
          />
          <image
            src="../../static/img/ic_login_delete.png"
            class="tc_boxi_jdel"
            v-if="jname"
          ></image>
        </view>
        <view class="tc_f">
          <view class="tc_fl" @tap="jshow_pop">取消</view>
          <view
            class="tc_fr"
            :style="{ opacity: jname ? '1' : '.6' }"
            @tap="jsave"
            >确定</view
          >
        </view>
      </view>

      <!-- 删除 -->
      <view :class="[ashowpop_jdel ? 'tc_box' : 'tc_box hide']">
        <view class="tc_boxt">
          删除文件夹？
        </view>
        <view class="tc_boxtc">
          将同时删除该文件夹内的文件
        </view>

        <view class="tc_f">
          <view class="tc_fl" @tap="jshow_pop">取消</view>
          <view class="tc_fr2" @tap="jshow_pop">删除</view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import request from '@/common/request.js';
import { mapState } from 'vuex';

export default {
  computed: mapState(['forcedLogin', 'hasLogin', 'userName']),

  data() {
    return {
      repeat_click: true,
      ashowpop: false,
      ashowpop_jrename: false,
      ashowpop_jrename2: false,
      ashowpop_jdel: false,
      ashowpopT: false,
      bj: false,
      yd: false,
      ashowpop_jtop_rl: false,

      jname: '',
      url: 'https://uniapp.dcloud.io/',
    };
  },

  methods: {
    // 跳转
    to_gis() {
      uni.navigateTo({
        url: '../doc/doc_gis',
      });
    },
    to_sh() {
      uni.navigateTo({
        url: '../doc/doc_user_share',
      });
    },

    bt_yd() {
      this.ashowpop = !this.ashowpop;
      this.ashowpopT = !this.ashowpopT;
      this.yd = !this.yd;
    },

    bt_yd2() {
      this.yd = !this.yd;
    },
    jshow_pop(a) {
      this.ashowpop = !this.ashowpop;
      this.ashowpop_jrename = false;
      this.ashowpop_jrename2 = false;
      this.ashowpop_jdel = false;
      this.ashowpopT = true;

      console.log(a);

      if (a == 'jtop_rl') {
        this.ashowpop_jtop_rl = true;

        this.ashowpopT = false;
        this.ashowpop = true;
        this.ashowpop_jrename = false;
        this.ashowpop_jrename2 = false;
      }

      if (a == 'jrename') {
        this.ashowpop_jtop_rl = false;
        this.ashowpopT = false;
        this.ashowpop = true;
        this.ashowpop_jrename = true;
        this.ashowpop_jrename2 = false;
      }
      if (a == 'jrename2') {
        this.ashowpop_jtop_rl = false;
        this.ashowpopT = false;
        this.ashowpop = true;
        this.ashowpop_jrename = false;
        this.ashowpop_jrename2 = true;
      }
      if (a == 'jdel') {
        this.ashowpop_jtop_rl = false;
        this.ashowpopT = false;
        this.ashowpop = true;
        this.ashowpop_jdel = true;
      }
    },
    togis() {
      uni.navigateTo({
        url: '../doc/doc_gis',
      });
    },
    listtwo() {
      uni.navigateTo({
        url: '../doc/doc_listtwo',
      });
    },
    navigateBack() {
      uni.navigateBack();
    },
  },
};
</script>

<style>
.tophr {
  width: 100%;
  height: 88rpx;
}
.uni-searchbar {
  box-shadow: none;
}

.nav {
  width: 100%;
  height: auto;
  display: block;
  float: left;
  background: #ffffff;
  border-bottom: 1px solid #dddddd;
  padding: 0 30rpx;
  box-sizing: border-box;
}
.nav text {
  width: auto;
  height: 32rpx;
  font-size: 24rpx;
  line-height: 32rpx;
  color: #999999;
  display: block;
  float: left;
  margin: 10rpx 15rpx 30rpx 0;
}
.nav text.active {
  color: #000000;
}
.nav image {
  width: 10rpx;
  height: 16rpx;
  display: block;
  float: left;
  margin: 20rpx 15rpx 30rpx 0;
}

.tc {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  display: none;
}

.jtop_bj {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
}
.tc_box {
  width: 540rpx;
  height: auto;
  background: #ffffff;
  border-radius: 14rpx;
  margin: 460rpx 105rpx 0;
  position: relative;
  z-index: 10001;
  overflow: hidden;
}
.tc_boxt {
  width: 100%;
  height: 44rpx;
  font-size: 36rpx;
  line-height: 44rpx;
  display: block;
  float: left;
  text-align: center;
  margin: 40rpx 0 20rpx;
  color: #000000;
}
.tc_boxtc {
  width: 100%;
  height: 36rpx;
  font-size: 28rpx;
  line-height: 36rpx;
  display: block;
  float: left;
  text-align: center;
  margin: 0rpx 0 30rpx;
  color: #666666;
}
.tc_boxi {
  width: 460rpx;
  height: 88rpx;
  background: #ffffff;
  border-radius: 8rpx;
  border: 1px solid #dddddd;
  display: block;
  float: left;
  margin: 0rpx 40rpx 22rpx 40rpx;
}
.tc_boxi input {
  width: 90%;
  height: 48rpx;
  margin: 20rpx 5%;
  font-size: 32rpx;
  color: #000000;
}
.tc_f {
  width: 100%;
  height: 100rpx;
  display: block;
  float: left;
  border-top: 1px solid #dcdee3;
  margin: 20rpx 0 0;
}
.tc_fl {
  width: 269rpx;
  height: 100rpx;
  line-height: 100rpx;
  text-align: center;
  font-size: 36rpx;
  color: #256aff;
  display: block;
  float: left;
  border-right: 1px solid #dcdee3;
}
.tc_fr {
  width: 269rpx;
  height: 100rpx;
  line-height: 100rpx;
  text-align: center;
  font-size: 36rpx;
  color: #256aff;
  display: block;
  float: left;
  opacity: 0.5;
}

.tc_fbox {
  width: 100%;
  height: auto;
  display: block;
  float: left;
  background: #ffffff;
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 10001;
}
.tc_fboxs {
  width: 100%;
  height: auto;
  display: block;
  float: left;
}
.tc_fbox_ic {
  width: 33.3333%;
  display: block;
  float: left;
  text-align: center;
  font-size: 28rpx;
  color: #666666;
}
.tc_fbox_ic image {
  width: 72rpx;
  height: 72rpx;
  display: block;
  float: none;
  margin: 60rpx auto 24rpx;
}
.tc_fbox_ic text {
  width: 100%;
  height: auto;
  display: block;
  float: none;
  margin: 0 auto 64rpx;
}
.tc_fbox_bt {
  width: 100%;
  height: 90rpx;
  line-height: 90rpx;
  display: block;
  float: left;
  text-align: center;
  font-size: 36rpx;
  color: #000000;
  border-top: 20rpx solid #f2f2f2;
}

.tc_list {
  width: 100%;
  height: auto;
  display: block;
  float: left;
  background: #ffffff;
}
.tc_list_t {
  width: 100%;
  height: 80rpx;
  display: block;
  float: left;
  background: #ffffff;
  font-size: 24rpx;
  color: #999999;
  line-height: 80rpx;
  margin: 0rpx 0;
  border-bottom: 1px solid #dddddd;
  text-align: center;
}
.tc_list {
  width: 100%;
  height: auto;
  display: block;
  float: left;
  border-bottom: 1px solid #dddddd;
}
.tc_list1 {
  width: auto;
  height: auto;
  display: block;
  float: left;
  font-size: 36rpx;
  color: #000000;
  line-height: 44rpx;
  margin: 34rpx 28rpx 38rpx 30rpx;
}
.tc_listtwo {
  width: auto;
  height: auto;
  display: block;
  float: left;
  font-size: 28rpx;
  color: #999999;
  line-height: 36rpx;
  margin: 42rpx 0rpx 0rpx 0rpx;
}
.tc_list image {
  width: 48rpx;
  height: 48rpx;
  display: block;
  float: right;
  margin: 36rpx 30rpx 0 0;
}

.doc_t {
  width: 690rpx;
  height: 32rpx;
  font-size: 24rpx;
  line-height: 32rpx;
  color: #999999;
  background: rgb(242, 242, 242);
  padding: 14rpx 30rpx;
  display: block;
  float: left;
}
.doc_bs {
  width: 100%;
  height: auto;
  display: block;
  float: left;
  background: #ffffff;
  border: 1px solid #dddddd;
  border-left: 0;
  border-right: 0;
}
.doc_b {
  width: 720rpx;
  height: auto;
  display: block;
  float: left;
  background: #ffffff;
  border-bottom: 1px solid #dddddd;
  margin: 0 0 0 30rpx;
}
.doc_bl {
  width: 64rpx;
  height: 64rpx;
  display: block;
  float: left;
  margin: 26rpx 20rpx 22rpx 0;
}
.doc_bt {
  width: auto;
  height: 42rpx;
  line-height: 42rpx;
  font-size: 34rpx;
  display: block;
  float: left;
  color: #000000;
  margin: 37rpx 0 0 0;
}
.doc_br {
  width: 48rpx;
  height: 48rpx;
  display: block;
  float: right;
  margin: 32rpx 30rpx 32rpx 0;
}
.doc_b2 {
  width: 450rpx;
  height: auto;
  display: block;
  float: left;
}
.doc_b2t {
  width: 450rpx;
  height: 42rpx;
  font-size: 34rpx;
  line-height: 42rpx;
  color: #000000;
  margin: 20rpx 0 4rpx;
  display: block;
  float: left;
}
.doc_b2f {
  width: 450rpx;
  height: 32rpx;
  font-size: 24rpx;
  line-height: 32rpx;
  color: #999999;
  margin: 0rpx 0 rpx;
  display: block;
  float: left;
}

.index {
  background: #ffffff;
  width: 100%;
  height: auto;
}
.jtop {
  width: 100%;
  height: 88rpx;
  background: #ffffff;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: inset 0px -1px 0px #dddddd;
}
.jtop_l {
  width: auto;
  height: 88rpx;
  display: block;
  float: left;
  font-size: 32rpx;
  color: #000000;
  line-height: 88rpx;
  margin: 0 0 0 30rpx;
}
.jtop_l image {
  width: 48rpx;
  height: 48rpx;
  display: block;
  float: left;
  margin: 20rpx 0 20rpx 0;
}
.jtop_lt {
  margin: 0 0 0 10rpx;
}
.jtop_r {
  width: 48rpx;
  height: 48rpx;
  display: block;
  float: right;
  margin: 20rpx 20rpx 0 0;
}
.jtop_rl {
  margin: 20rpx 30rpx 0 0;
}
.jtop_r image {
  width: 48rpx;
  height: 48rpx;
  display: block;
  float: left;
}
.jtop_c {
  width: 70%;
  height: 48rpx;
  line-height: 48rpx;
  display: block;
  float: left;
  position: fixed;
  top: 20rpx;
  left: 15%;
  text-align: center;
  font-size: 36rpx;
  color: #000000;
}
.jtop_c image {
  width: 36rpx;
  height: 36rpx;
  display: inline-block;
  float: none;
  margin-bottom: -5rpx;
  margin-left: 5rpx;
}
.jtop_b {
  width: 100%;
  height: auto;
  background: #ffffff;
  position: fixed;
  top: 88rpx;
  left: 0;
  z-index: 1001;
}

.tc_box {
  width: 540rpx;
  height: auto;
  background: #ffffff;
  border-radius: 14rpx;
  margin: 460rpx 105rpx 0;
  position: relative;
  z-index: 10001;
  overflow: hidden;
}
.tc_boxt {
  width: 100%;
  height: 44rpx;
  font-size: 36rpx;
  line-height: 44rpx;
  display: block;
  float: left;
  text-align: center;
  margin: 40rpx 0 20rpx;
  color: #000000;
}
.tc_boxtc {
  width: 100%;
  height: 36rpx;
  font-size: 28rpx;
  line-height: 36rpx;
  display: block;
  float: left;
  text-align: center;
  margin: 0rpx 0 30rpx;
  color: #666666;
}
.tc_boxi {
  width: 460rpx;
  height: 88rpx;
  background: #ffffff;
  border-radius: 8rpx;
  border: 1px solid #dddddd;
  display: block;
  float: left;
  margin: 0rpx 40rpx 22rpx 40rpx;
}
.tc_boxi input {
  width: 70%;
  height: 48rpx;
  margin: 20rpx 5%;
  font-size: 32rpx;
  color: #000000;
  float: left;
}
.tc_boxi image {
  width: 36rpx;
  height: 36rpx;
  display: block;
  float: right;
  margin: 26rpx 20rpx 0rpx 0;
}

.tc_f {
  width: 100%;
  height: 100rpx;
  display: block;
  float: left;
  border-top: 1px solid #dcdee3;
  margin: 20rpx 0 0;
}
.tc_fl {
  width: 269rpx;
  height: 100rpx;
  line-height: 100rpx;
  text-align: center;
  font-size: 36rpx;
  color: #256aff;
  display: block;
  float: left;
  border-right: 1px solid #dcdee3;
}
.tc_fr {
  width: 269rpx;
  height: 100rpx;
  line-height: 100rpx;
  text-align: center;
  font-size: 36rpx;
  color: #256aff;
  display: block;
  float: left;
  opacity: 0.5;
}
.tc_fr2 {
  width: 269rpx;
  height: 100rpx;
  line-height: 100rpx;
  text-align: center;
  font-size: 36rpx;
  color: #eb5342;
  display: block;
  float: left;
}

.tc {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  display: block;
}
.jtop_bj {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
}
.tc_fbox_bt {
  width: 100%;
  height: 90rpx;
  line-height: 90rpx;
  display: block;
  float: left;
  text-align: center;
  font-size: 36rpx;
  color: #000000;
  border-top: 20rpx solid #f2f2f2;
  background: #ffffff;
}
.tc_fbox {
  width: 100%;
  height: auto;
  display: block;
  float: left;
  background: #f2f2f2;
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 10001;
}

.ddf {
  width: 120rpx;
  height: auto;
  display: block;
  float: left;
  margin: 30rpx 0 20rpx 40rpx;
}
.ddf image {
  width: 112rpx;
  height: 112rpx;
  display: block;
  float: left;
  margin: 0 4rpx 20rpx;
}
.ddf text {
  width: 120rpx;
  height: auto;
  display: block;
  float: left;
  margin: 0 0 20rpx;
  font-size: 24rpx;
  line-height: 32rpx;
  text-align: center;
  color: #000000;
}
.tc_tt {
  width: 100%;
  height: auto;
  display: block;
  float: left;
  margin: 40rpx 0 0;
  font-size: 28rpx;
  line-height: 36rpx;
  text-align: center;
  color: #999999;
}
</style>
